<template>
    <div>
        <h1>登陆成功,<span id="name"></span></h1>
        欢迎!<b @click="login">点这里</b><br>
        <button @click="top">返回首页</button>

    </div>
</template>

<script>
    export default {
        methods: {
            login () {
                //this.$router.replace('/login')
                //alert(document.getElementById("name").innerHTML);
                alert(this.$route.params.name);
                document.getElementById("name").innerHTML=this.$route.params.name;
            },
            top (){
                this.$router.push('/');
            }
        }
    }
</script>